<template>
	<view class="wp">
		<view class="top">
			<image src="/static/order/pjyfb.png" mode="widthFix"></image>
			<view>评价已发布</view>
		</view>
		<view class="good">
			<view class="head">推荐团购</view>
			<view class="g_list">
				<view class="list_item" v-for="item in list" @click="$navTo('/pages/product/groupbuy?id='+item.id)"
					:key="item.id">
					<view class="l_position">
						<image :src="item.thumb"></image>
						<!-- <view class="l_address">
							<view class="l_tit"><image src="/static/group/add.png" mode="widthFix"></image><text>{{item.supplier.shortaddress}}</text></view>
							<view class="l_dis">{{item.supplier.distance}}</view>
						</view> -->
					</view>
					<!-- <text v-if="item.shareprice" class="l_money">{{item.shareprice}}</text> -->
					<view class="l_info">
						<text class="list_title clamp">{{item.title}}</text>
						<!-- <view class="l_small">
							<text>已售{{item.sales}}</text>
						</view> -->
						<!-- <view class="l_hot">
							<view class="l_tips">
								<view v-if="item.cardnum>0" class="l_card">次卡</view>
								<view class="label"><image src="/static/group/zhe.png" mode="widthFix"></image><text v-text="item.mark+'热销中'"></text></view>
							</view>
						</view> -->
						<view class="l_cart">
							<text class="money">{{item.saleprice}}<text class="money_num" v-if="item.cardnum>0">/{{item.cardnum}}次</text></text>
							<!-- <text class="old_money">￥{{item.productprice}}</text> -->
						</view>
						<!-- <view class="l_member">
							<image :src="item.supplier.logo" mode=""></image>
							<text class="clamp">{{item.supplier.supname}}</text>
						</view> -->
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import {mapState} from 'vuex'
	export default {
		data() {
			return {
				list: [],
			};
		},
		computed: {
		  	...mapState(['Location'])
		},
		onLoad(){
			this.getList();
		},
		methods: {
			getList(){
				this.$axios('home/homegroup', 'POST', 'shop', this.Location).then((res => {
					if (res.data.code == 200) {
						this.list = res.data.data.list;
					}
				}))
			},
		}
	}
</script>

<style lang="scss">
	page{
		background: #FBF8FE;
	}
	.wp{
		padding: 30rpx;
	}
	.top{
		text-align: center;
		padding: 60rpx 0;
		font-size: 36rpx;
		color: #333333;
		background: #FFFFFF;
		border-radius: 12rpx;
		font-weight: bold;
		image{
			width: 78rpx;
			margin-bottom: 10rpx;
		}
	}
	.good{
		.head{
			text-align: center;
			font-size: 28rpx;
			color: #333333;
			font-weight: 600;
			line-height: 3;
		}
	}
	.g_list {
		display: flex;
		align-items: center;
		flex-wrap: wrap;
		justify-content: space-between;
		.list_item {
			background: #fff;
			border-radius: 12rpx;
			box-sizing: border-box;
			// margin: 0 10rpx 24rpx;
			padding-bottom: 10rpx;
			position: relative;
			width: 48.5%;
			overflow: hidden;
			margin-bottom: 20rpx;
			.l_position{
				position: relative;
				width: 100%;
				height: 290rpx;
				overflow: hidden;
				image {
					width: 100%;
					display: block;
					height: 100%;
				}
				.l_address{
					position: absolute;
					background-color: rgba(0,0,0,0.5);
					color: #fff;
					left: 0;
					bottom: 0;
					display: flex;
					border-radius: 0rpx 8rpx 0rpx 0rpx;
					font-size: 20rpx;
					.l_tit{
						background: linear-gradient( 90deg, #B82CF0 0%, #8816E1 100%);
						display: flex;
						align-items: center;
						padding: 2rpx 6rpx;
						image{
							width: 16rpx;
							margin-right: 4rpx;
						}
					}
					.l_dis{
						padding: 2rpx 6rpx;
					}
				}
			}
			.l_money{
				position: absolute;
				background-color: rgba(0,0,0,0.5);
				border-radius: 6rpx;
				padding: 2rpx 6rpx;
				color: #fff;
				font-size: 20rpx;
				right: 0;
				top: 0;
			}
			.l_info{
				padding: 10rpx 20rpx;
				.list_title {
					font-weight: bold;
					overflow: hidden;
					line-height: 45upx;
					white-space: nowrap;
					font-size: 28rpx;
					color: #333333;
				}
				.l_small{
					color: #999999;
					font-size: 20rpx;
					padding-top: 4rpx;
					text{
						margin-right: 8rpx;
					}
				}
				
				.l_cart {
					display: flex;
					align-items: flex-end;
					.money {
						color: #AF141D;
						font-size: 28rpx;
						font-weight: bold;
						margin-right: 10upx;
						.money_num{
							font-size: 20rpx;
						}
						&:before {
							content: '￥';
							font-size: 20rpx;
						}
					}
					
					.old_money {
						color: #999999;
						font-size: 20rpx;
						text-decoration: line-through;
					}
				}
				
				.l_hot {
					color: #750CD5;
					display: flex;
					align-items: center;
					justify-content: space-between;
					margin: 6rpx 0;
					.l_tips{
						display: flex;
						.l_card{
							width: 64rpx;
							height: 34rpx;
							line-height: 34rpx;
							background: #FFF0DA;
							border-radius: 8rpx;
							border: 2rpx solid #E19C37;
							font-size: 20rpx;
							color: #E19C37;
							text-align: center;
							margin-right: 10rpx;
						}
					}
					.label {
						background: linear-gradient( 270deg, #8816E1 0%, #B92DF1 100%);
						height: 34rpx;
						color: #FFFFFF;
						line-height: 34rpx;
						border-radius: 8rpx;
						display: flex;
						align-items: center;
						font-size: 20rpx;
						padding: 0 8rpx;
						text{
							margin: 0 5upx;
						}
						image{
							width: 20rpx;
							margin-right: 4rpx;
						}
					}
				}
				
				.l_member {
					font-size: 20rpx;
					display: flex;
					align-items: center;
					color: #333333;
					margin-top: 10rpx;
					image {
						border-radius: 50%;
						width: 28rpx;
						height: 28rpx;
						margin-right: 10upx;
						vertical-align: bottom;
					}
					text {
						width: 80%;
					}
				}
			}
			
		}
	}
	
</style>
